package org.world.api.query;

import org.mc.ddd.infrastructure.persistent.PageQueryParams;
import org.mc.ddd.infrastructure.persistent.PageQueryResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.world.api.query.response.AnimalGodPageItemVo;
import org.world.applicaiton.annimal.query.AnimalViewQueryService;

import javax.annotation.Resource;

@RestController
public class AnimalQueryController {
    @Resource
    private AnimalViewQueryService animalViewQueryService;

    /**
     * 上帝查看动物
     */
    @GetMapping("/god/see/animals")
    public PageQueryResult<AnimalGodPageItemVo> page(PageQueryParams pageParams) {
        return PageQueryResult.forClass(AnimalGodPageItemVo.class).from(animalViewQueryService.page(pageParams));
    }
}
